<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="http://localhost:3000?name=tom">打开网站</a>
    <p>
        <button onclick="btn()">按钮</button>
    </p>
    <p>
        <form action="http://localhost:3000" method="get">
            用户名 <input type="text" name="username" value="">
            <input type="submit" value="submit">
        </form>
    </p>
    
    <script>
        function btn(){
            let name = "mary"
            let age = 20
            location.href=`http://localhost:3000?username=${name}&userage=${age}`
        }
    </script>
</body>
</html>